package Actions;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileReader;
import java.util.Scanner;

import javax.swing.*;

import view.ScriptEditor;
import view.ViewController;
import view.slogoFile;

public class FileLoadScript extends AbstractActionPerformed {

	private JFileChooser fileChoose = new JFileChooser(System.getProperty("user.dir"));
	
	@Override
	public void action(ViewController listener, ActionEvent e) {
		fileChoose.setFileFilter(new slogoFile());
		int chosen = fileChoose.showOpenDialog(null);
		
		if (chosen == JFileChooser.APPROVE_OPTION)
		{
			File f = fileChoose.getSelectedFile();
			
			try {
				Scanner s = new Scanner(f).useDelimiter("\\Z");
				String fileContent = s.next();
			}
			catch (Exception ex){
				ex.printStackTrace();
			}
			
			listener.
			
		}

	}
	

}
